#include <iostream>
#include <string>
//#include <time.h>
#include <ctime>

#define ONE 1
#define SHOW_DEBUG

using namespace std;
int main( void )
{
	bool Play = true;
	int a, b;
	int tries(0);
	// Variable declaration
	bool BOARD[5][5] =  {false};/*{{0,1,2},
								{3,4,5},
								{6,7,8},
								{9,10,11}
								};
								*/

	// Initialize board - add bombs.
	srand( time(0));
	for ( int i = 0; i < 4; ++i )
	{
		int x = rand()%5;
		int y = rand()%5;

#ifdef SHOW_DEBUG
		cout<<x<<" "<<y<<endl;
#endif
		BOARD[x][y] = true;
	}


	while ( Play )
	{

		if ( tries == 5 )
		{
			cout << "Congratulations, you survived!" << endl;
			Play = false;
			continue;
		}

		cout<<"enter A: ";
		cin>>a;
		cout<<"enter B: ";
		cin>>b;

		if(BOARD[a][b] == true)
		{
			cout<<"\nBOOM";
			Play = false;
		}
		else
		{
			++tries;
		}

		////////////// RENDER LOOP /////////////
		for(int x = 0;x<=4; x++)
		{
			cout << "----------------" <<endl << '|';
			for(int y = 0; y<=4; y++)
			{
				cout<<BOARD[x][y]<<" |";
			}
			cout<<endl;
		}
		cout << "----------------" <<endl;
		////////////// RENDER LOOP /////////////

		system( "Pause" );
	}

	system("pause");
	return 0;
}